package com.hl.web;

import com.hl.pojo.User;
import com.hl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/listAll")
    public List<User> listAll(){
        System.out.println("-----------");
        System.out.println("0000000000000");
        System.out.println("============");
        return userService.listAll();
    }

    @RequestMapping("/saveAll")
    public int saveAll(@RequestBody List<User> list){
        return userService.saveAll(list);
    }
}
